package com.osgix.authorize.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.osgix.authorize.dao.UserInfoDao;
import com.osgix.authorize.model.UserInfo;
import com.osgix.authorize.service.UserInfoManager;
import com.osgix.common.orm.ibatis.EntityDao;
import com.osgix.common.orm.ibatis.Page;
import com.osgix.common.orm.ibatis.PageRequest;
import com.osgix.common.service.AbsBaseManager;

@Service("userInfoManager")
@Transactional
public class UserInfoManagerImpl extends AbsBaseManager<UserInfo, java.lang.Long> implements UserInfoManager {

	private UserInfoDao userInfoDao;

	/**增加setXXXX()方法,spring就可以通过autowire自动设置对象属性,请注意大小写*/
	@Resource
	public void setUserInfoDao(UserInfoDao dao) {
		this.userInfoDao = dao;
	}

	public EntityDao getEntityDao() {
		return this.userInfoDao;
	}

	public int deleteByLoginAccount(java.lang.String loginAccount) {
		return userInfoDao.deleteByLoginAccount(loginAccount);
	}

	@Transactional(readOnly = true)
	public UserInfo getByLoginAccount(java.lang.String loginAccount) {
		return userInfoDao.getByLoginAccount(loginAccount);
	}

	public Page findPage(PageRequest pr) {
		return userInfoDao.findPage(pr);
	}

}
